package l.l.test.ThinkingInJava;

/**
 * Created by llw on 2018/1/16.
 */
public class TryUsingAnonymousClass {
    public void useMyInterface() {
        final Integer number = 123;
        System.out.println(number);

        MyInterface myInterface = new MyInterface() {
            @Override
            public void doSomething() {
                System.out.println(number);
            }
        };
        myInterface.doSomething();

        System.out.println(number);
    }

    public static void main(String[] args) {

    }
}
interface MyInterface {
    void doSomething();
}
